]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
NetworkMenu: actually add new access point to the network list
authorGiovanni Campagna <gcampagna@src.gnome.org>
Sat, 17 Dec 2011 22:54:45 +0000 (23:54 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Mon, 19 Dec 2011 15:54:46 +0000 (16:54 +0100)
Previously the code in _accessPointAdded was iterating over the
the network list to find a good place, and at that time, added both
the network to the list and the item to the menu. When I refactored
to call queueCreateSection, I forgot to add code to insert the
network in the list.
Add it now, using the new Util.insertSorted function.

https://bugzilla.gnome.org/show_bug.cgi?id=666429

js/ui/status/network.js

index 863792d0d1df87372317f339f6e0d7332741bb8f..fcf0835c165f1c72bdb07f484c3d052b577414df 100644 (file)
@@ -1234,7 +1234,6 @@ const NMDeviceWireless = new Lang.Class({
                       accessPoints: [ accessPoint ]
                     };
             apObj.ssidText = ssidToLabel(apObj.ssid);
-            needsupdate = true;
         }
 
         // check if this enables new connections for this group
@@ -1249,7 +1248,11 @@ const NMDeviceWireless = new Lang.Class({
             }
         }
 
-        if (needsupdate) {
+        if (pos == -1 || needsupdate) {
+            if (pos != -1)
+                this._networks.splice(pos, 1);
+            pos = Util.insertSorted(this._networks, apObj, this._networkSortFunction);
+
             this._clearSection();
             this._queueCreateSection();
         }